﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace fabrica2CSharp
{
    public partial class Principal : Form
    {
        public Principal()
        {
            InitializeComponent();
            this.Enabled = false;
        }

        private void Principal_Load(object sender, EventArgs e)
        {
            Login login = new Login();
            DialogResult aux = DialogResult.Retry;
            while (aux != DialogResult.OK)
            {
                aux = login.ShowDialog();
                if (aux == DialogResult.Abort)
                {
                    login.Close();
                    this.Close();
                }

            }
            this.Enabled = true;
        }

        private void cadastrarClienteToolStripMenuItem_Click(object sender, EventArgs e)
        {
            CadCliente cadCliente = new CadCliente();
            cadCliente.MdiParent = this;
            cadCliente.Show();
        }

        private void visualizarClientesToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ViwCliente viwCliente = new ViwCliente();
            viwCliente.MdiParent = this;
            viwCliente.Show();
        }

        private void cadastrarFuncionárioToolStripMenuItem_Click(object sender, EventArgs e)
        {
            CadFunc cadFunc = new CadFunc();
            cadFunc.MdiParent = this;
            cadFunc.Show();
        }

        private void visualizarFuncionáriosToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ViwFunc viwFunc = new ViwFunc();
            viwFunc.MdiParent = this;
            viwFunc.Show();
        }

        private void novoEventoToolStripMenuItem_Click(object sender, EventArgs e)
        {
            CadEvento cadEvento = new CadEvento();
            cadEvento.MdiParent = this;
            cadEvento.Show();
        }

        private void visualizarEventoToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ViwEvento viwEvento = new ViwEvento();
            viwEvento.MdiParent = this;
            viwEvento.Show();
        }

        private void novaAcaoToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            CadAcao cadAcao = new CadAcao();
            cadAcao.MdiParent = this;
            cadAcao.Show();
        }

        private void relatorioDaAcaoToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ViwAcao viwAcao = new ViwAcao();
            viwAcao.MdiParent = this;
            viwAcao.Show();
        }

    }
}
